package com.atkxp.service;

import com.atkxp.dao.BlogMapper;
import com.atkxp.dao.UserMapper;
import com.atkxp.pojo.Blog;
import com.atkxp.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author user
 * @declaration
 * @create 2023/1/15-23:55
 */
@Service
public class RankListServiceImpl implements RankListService{

    @Autowired
    public BlogMapper blogMapper;

    @Autowired
    public UserMapper userMapper;

    @Override
    public List<User> rankListForUserOrderByBlogCounts() {
        return userMapper.getTopSevenUserOrderByBlogNum();
    }

    @Override
    public List<Blog> rankListForBlogOrderByLikes() {
        return blogMapper.getTopSevenBlogOrderByLikes();
    }

    @Override
    public List<Blog> rankListForBlogOrderByViews() {
        return blogMapper.getTopSevenBlogOrderByBrowsesNum();
    }
}
